﻿<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:Ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:Database="clr-namespace:Daytimer.DatabaseHelpers;assembly=Daytimer.DatabaseHelpers"
		xmlns:local="clr-namespace:Daytimer.Controls.Tasks" xmlns:Controls="clr-namespace:Daytimer.Controls"
		xmlns:Friction="clr-namespace:Daytimer.Controls.Friction"
		xmlns:Fundamentals="clr-namespace:Daytimer.Fundamentals;assembly=Daytimer.Fundamentals"
		x:Class="Daytimer.Controls.Tasks.TasksView" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="900"
		Background="Transparent" ClipToBounds="True">
	<Grid.Resources>
		<ResourceDictionary>
			<DataTemplate DataType="{x:Type Database:UserTask}">
				<Grid x:Name="taskGrid" Background="Transparent" ContextMenuOpening="taskGrid_ContextMenuOpening">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>
					<Grid.ContextMenu>
						<ContextMenu>
							<MenuItem x:Name="completeMenuItem" Header="_Mark Complete" Click="completeMenuItem_Click">
								<MenuItem.Icon>
									<Image
											Source="pack://application:,,,/Daytimer.Images;component/Images/greencheck.png" />
								</MenuItem.Icon>
							</MenuItem>
							<Separator />
							<MenuItem x:Name="deleteMenuItem" Header="_Delete" Click="deleteMenuItem_Click">
								<MenuItem.Icon>
									<Image
											Source="pack://application:,,,/Daytimer.Images;component/Images/delete_sml.png" />
								</MenuItem.Icon>
							</MenuItem>
						</ContextMenu>
					</Grid.ContextMenu>
					<TextBlock Text="{Binding Subject}" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
							Margin="0,0,5,0" IsHitTestVisible="False" />
					<Image Grid.Column="1"
							Source="pack://application:,,,/Daytimer.Images;component/Images/highpriority.png"
							Stretch="None" Width="16" Height="16" Margin="0,0,8,0" Visibility="{Binding HighPriority}"
							IsHitTestVisible="False" />
					<Image Grid.Column="2" Source="pack://application:,,,/Daytimer.Images;component/Images/redflag.png"
							Stretch="None" Opacity="{Binding Overdue}" Visibility="{Binding ShowFlag}" Width="16"
							Height="16" IsHitTestVisible="False" />
					<Image Grid.Column="2"
							Source="pack://application:,,,/Daytimer.Images;component/Images/greencheck.png"
							Stretch="None" Visibility="{Binding ShowCheck}" Width="16" Height="16"
							IsHitTestVisible="False" />
				</Grid>
			</DataTemplate>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="../../CancelEditButton.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</Grid.Resources>
	<Grid.RowDefinitions>
		<RowDefinition Height="40" />
		<RowDefinition Height="Auto" />
		<RowDefinition Height="*" />
	</Grid.RowDefinitions>
	<Grid.ColumnDefinitions>
		<ColumnDefinition Width="12*" MinWidth="130" />
		<ColumnDefinition Width="28*" MinWidth="200" />
	</Grid.ColumnDefinitions>
	<GridSplitter Grid.Column="1" HorizontalAlignment="Left" Width="20" Grid.RowSpan="3" Background="Transparent"
			Focusable="False" Margin="0,8,0,0">
		<GridSplitter.Template>
			<ControlTemplate TargetType="GridSplitter">
				<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
						Background="{TemplateBinding Background}">
					<Border Width="1" BorderThickness="0" Background="#FFD4D4D4" />
				</Border>
			</ControlTemplate>
		</GridSplitter.Template>
	</GridSplitter>
	<!--<Grid Margin="10,0,1,0" Height="23">
		<TextBlock x:Name="newTaskWatermark" Text="Type a new task" Padding="5,0,0,0" VerticalAlignment="Center"
				Foreground="#FF808080" />
		<TextBox x:Name="newTaskTextBox" SpellCheck.IsEnabled="True" MaxLines="1" VerticalContentAlignment="Center"
				Padding="2,0" Background="{x:Null}" KeyDown="newTaskTextBox_KeyDown"
				TextChanged="newTaskTextBox_TextChanged" />
	</Grid>-->
	<Fundamentals:PlaceholderTextBox x:Name="newTaskTextBox" PlaceholderText="Type a new task" Height="23"
			Margin="10,0,1,0" KeyDown="newTaskTextBox_KeyDown" />
	<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="10,0,1,1">
		<StackPanel.Resources>
			<Style TargetType="RadioButton">
				<Setter Property="FontSize" Value="15" />
				<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
				<Setter Property="Focusable" Value="False" />
				<Setter Property="GroupName" Value="_displayTaskType" />
				<Setter Property="Padding" Value="8,0" />
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="RadioButton">
							<Border Background="Transparent" Padding="{TemplateBinding Padding}">
								<ContentPresenter />
							</Border>
							<ControlTemplate.Triggers>
								<Trigger Property="IsMouseOver" Value="True">
									<Setter Property="Foreground" Value="{DynamicResource WindowBorderFocused}" />
								</Trigger>
								<Trigger Property="IsChecked" Value="True">
									<Setter Property="Foreground" Value="{DynamicResource WindowBorderFocused}" />
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</StackPanel.Resources>
		<RadioButton x:Name="activeTasksRadio" Content="Active" IsChecked="True" Checked="activeTasksRadio_Checked" />
		<RadioButton x:Name="allTasksRadio" Content="All" Checked="allTasksRadio_Checked" />
	</StackPanel>
	<local:DraggableTreeView x:Name="tasksTreeView" Grid.Row="2" BorderThickness="0"
			SelectedItemChanged="tasksTreeView_SelectedItemChanged"
			ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible"
			ItemReorder="tasksTreeView_ItemReorder" VirtualizingStackPanel.IsVirtualizing="True"
			VirtualizingStackPanel.VirtualizationMode="Recycling" Background="Transparent" Margin="9,0,0,0"
			MouseDoubleClick="tasksTreeView_MouseDoubleClick" Focusable="False">
		<local:DraggableTreeView.CacheMode>
			<BitmapCache EnableClearType="True" />
		</local:DraggableTreeView.CacheMode>
	</local:DraggableTreeView>
	<TextBlock x:Name="statusText" Grid.Row="2" Text="Loading..." HorizontalAlignment="Center" VerticalAlignment="Top"
			Margin="10,25,25,0" Foreground="#FFB2B2B2" TextWrapping="Wrap" TextAlignment="Center"
			IsHitTestVisible="False" />
	<Grid x:Name="detailsGrid" Grid.Column="1" Grid.RowSpan="3" Margin="18,3,3,3" Visibility="Hidden"
			Background="Transparent" RenderOptions.BitmapScalingMode="LowQuality"
			PreviewMouseWheel="detailsGrid_PreviewMouseWheel">
		<Grid.CacheMode>
			<BitmapCache />
		</Grid.CacheMode>
		<Grid.Resources>
			<Style TargetType="TextBlock">
				<Setter Property="Foreground" Value="#FF9B9AB3" />
				<Setter Property="Margin" Value="3,7,0,7" />
				<Setter Property="VerticalAlignment" Value="Center" />
			</Style>
		</Grid.Resources>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		<Image Source="pack://application:,,,/Daytimer.Images;component/Images/info_sml.png" Stretch="None"
				HorizontalAlignment="Left" Margin="3,7,0,7" Width="16"
				Visibility="{Binding Visibility, ElementName=dueDateText}" />
		<TextBlock x:Name="dueDateText" Text="Due in x days." Foreground="#FF444444" HorizontalAlignment="Left"
				VerticalAlignment="Center" Grid.ColumnSpan="5" Margin="23,0,0,0" />
		<Button x:Name="closeButton" Style="{StaticResource closeButton}" Grid.Column="5" Height="22" Margin="0,4,4,4"
				Width="22" Click="closeButton_Click">
			<Button.ToolTip>
				<Ribbon:RibbonToolTip Title="Discard Changes"
						Description="Stop editing this task. Any unsaved changes will be lost." />
			</Button.ToolTip>
		</Button>
		<Grid x:Name="categoryGrid" Visibility="Collapsed" Grid.Row="1" Grid.ColumnSpan="5" Margin="3" Height="23">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Rectangle x:Name="categoryRect" Width="6" VerticalAlignment="Stretch" Fill="#30000000" />
			<TextBlock x:Name="categoryText" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left"
					TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" Margin="12,0"
					Foreground="{DynamicResource Black}" />
		</Grid>
		<TextBlock Text="Subject" Grid.Row="2" Height="15" Margin="3,8,0,8" />
		<TextBox x:Name="editSubject" Grid.Column="1" Margin="10,4,3,4" SpellCheck.IsEnabled="True" Grid.ColumnSpan="4"
				Grid.Row="2" />
		<TextBlock Text="Start date" Grid.Row="3" Height="16" />
		<DatePicker x:Name="editStartDate" Grid.Column="1" Grid.Row="3" Margin="10,3" HorizontalAlignment="Left"
				VerticalAlignment="Center" DisplayDateEnd="{Binding SelectedDate, ElementName=editDueDate}" Height="24"
				Width="130" />
		<!--<Controls:DatePickerControl x:Name="editStartDate" Grid.Column="1" Grid.Row="3" Margin="10,3"
					HorizontalAlignment="Left" VerticalAlignment="Center"
					DisplayDateEnd="{Binding SelectedDate, ElementName=editDueDate}" Height="24" Width="130" />-->
		<TextBlock Text="Due date" Grid.Row="4" Height="16" />
		<DatePicker x:Name="editDueDate" Grid.Column="1" Grid.Row="4" Margin="10,3" HorizontalAlignment="Left"
				VerticalAlignment="Center" DisplayDateStart="{Binding SelectedDate, ElementName=editStartDate}"
				Height="24" Width="130" SelectedDateChanged="editDueDate_SelectedDateChanged" />
		<!--<Controls:DatePickerControl x:Name="editDueDate" Grid.Column="1" Grid.Row="4" Margin="10,3"
					HorizontalAlignment="Left" VerticalAlignment="Center"
					DisplayDateStart="{Binding SelectedDate, ElementName=editStartDate}" Height="24" Width="130" />-->
		<CheckBox x:Name="reminderEnabled" Content="Reminder" Grid.Row="5" VerticalContentAlignment="Center"
				Margin="3,7,0,7" Foreground="#FF9B9AB3" Checked="reminderEnabled_Checked" />
		<DatePicker x:Name="editReminderDate" Grid.Column="1" Grid.Row="5" Margin="10,3" HorizontalAlignment="Left"
				VerticalAlignment="Center" Height="24" Width="130"
				IsEnabled="{Binding IsChecked, ElementName=reminderEnabled}"
				DisplayDateEnd="{Binding SelectedDate, ElementName=editDueDate}"
				SelectedDateChanged="editReminderDate_SelectedDateChanged" />
		<!--<Controls:DatePickerControl x:Name="editReminderDate" Grid.Column="1" Grid.Row="5" Margin="10,3"
					HorizontalAlignment="Left" VerticalAlignment="Center" Height="24" Width="130"
					IsEnabled="{Binding IsChecked, ElementName=reminderEnabled}"
					DisplayDateEnd="{Binding SelectedDate, ElementName=editDueDate}"
					OnSelectedDateChangedEvent="editReminderDate_OnSelectedDateChangedEvent" />-->
		<Controls:TimeDropDown x:Name="editReminderTime" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Left"
				Margin="3,4,0,4" Grid.Row="5" VerticalAlignment="Center" Width="120" Height="22"
				IsEnabled="{Binding IsChecked, ElementName=reminderEnabled}" />
		<TextBlock Text="Status" Grid.Row="3" Grid.Column="2" Height="16" />
		<ComboBox x:Name="editStatus" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Left" VerticalAlignment="Center"
				Height="22" Width="180" Margin="10,4,0,4" SelectionChanged="editStatus_SelectionChanged">
			<ComboBoxItem Content="Not Started" />
			<ComboBoxItem Content="In Progress" />
			<ComboBoxItem Content="Completed" />
			<ComboBoxItem Content="Waiting on someone else" />
			<ComboBoxItem Content="Deferred" />
		</ComboBox>
		<TextBlock Text="Priority" Grid.Row="4" Grid.Column="2" Height="16" />
		<ComboBox x:Name="editPriority" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Left"
				VerticalAlignment="Center" Height="22" Width="100" Margin="10,4"
				SelectionChanged="editPriority_SelectionChanged">
			<ComboBoxItem Content="Low" />
			<ComboBoxItem Content="Normal" />
			<ComboBoxItem Content="High" />
		</ComboBox>
		<TextBlock Text="% Complete" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Right" />
		<local:DomainUpDown x:Name="editPercentComplete" Grid.Column="4" HorizontalAlignment="Left" Grid.Row="4"
				VerticalAlignment="Center" Width="70" Height="24" Margin="10,4"
				OnValueChangedEvent="editPercentComplete_OnValueChangedEvent" />
		<Friction:FrictionRichTextBoxControl x:Name="editDetails" Grid.Row="6" Grid.ColumnSpan="5" Margin="3,3,3,4"
				Padding="5,10" SpellCheck.IsEnabled="True" AcceptsReturn="True" AcceptsTab="True" UndoLimit="1024"
				FontFamily="Calibri" FontSize="14.667" VerticalScrollBarVisibility="Auto" IsDocumentEnabled="True"
				VerticalContentAlignment="Top">
			<Friction:FrictionRichTextBoxControl.Resources>
				<Style TargetType="{x:Type Paragraph}">
					<Setter Property="Margin" Value="0" />
					<Setter Property="BorderBrush" Value="#FF040404" />
				</Style>
				<Controls:UriToolTipConverter x:Key="UriToolTipConverter" />
				<Style TargetType="{x:Type Hyperlink}">
					<EventSetter Event="Click" Handler="Hyperlink_Click" />
					<EventSetter Event="MouseEnter" Handler="Hyperlink_MouseEnter" />
					<EventSetter Event="MouseLeave" Handler="Hyperlink_MouseLeave" />
					<Setter Property="ToolTip"
							Value="{Binding NavigateUri, RelativeSource={RelativeSource Self}, Converter={StaticResource UriToolTipConverter}}" />
				</Style>
			</Friction:FrictionRichTextBoxControl.Resources>
		</Friction:FrictionRichTextBoxControl>
	</Grid>
</Grid>
